# -*- coding: utf-8 -*-
"""
file:ch5_6微分工具Sympy
author: Fuwen
time: 2022/7/16 17:11
software:PyCharm
"""
from sympy import *

x = Symbol('x')
f = Symbol('f')
f = 3 * x**2 + 2 * x + 10

print('f′(x) = {}'.format(f.diff()))
print('f′(x) = {}'.format(diff(f, x)))  # 默认一次微分
print('f′({}) = {}'.format(x, diff(f, x, 2)))  # 二阶导， 连续两次微分